package e2e;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.List;

public class Main {

    public static void main(String[] args) {
        // 解析配置文件目录下的所有 XML 文件
        File xmlDirectory = new File("C:\\tmp\\x1");
        List<String> transactionIds = XMLParser.parseXMLDirectory(xmlDirectory);

        String allTran = String.join(";", transactionIds);
        System.out.println(allTran);

        String filePath = "output.txt";

        try (BufferedWriter writer = new BufferedWriter(new FileWriter(filePath))) {
            writer.write(allTran);
        } catch (IOException e) {
            e.printStackTrace();
        }

        // 递归代码内容，检查文本文件是否命中结果集中的属性值
        File textDirectory = new File("C:\\tmp\\h");
        File outputFile = new File("C:\\tmp\\h\\result.txt");
        TextSearch.searchAndWrite(textDirectory, transactionIds, outputFile);
    }
}



